var Ajax = require('../../utils/Ajax.js')
var utils = require('../../utils/util.js');
var app = getApp();
Component({
  properties: {
    data: {
      type: Object,
      value: {}
    }
  },
  methods: {
    bindsubmit(e) {
      var formId = e.detail.formId;
      if (formId == "the formId is a mock one"){//非真机
        return;
      }
      console.log(formId)
      var openId = app.getValueSync('openid');
      var unionId = app.getValueSync('unionId');
      if (openId && unionId){
        Ajax.post('addXcxFromId',{
          formId: formId,
          openId,
          unionId,
          appId: app.globalData.appId,
          expireTime: new Date().getTime() + 604800000
        },null,true).then((d) => {
          console.log('打印formId' + formId)
          console.log(d)
        })
      }
    }
  }
})
